import 'package:example_example/services/ScreenAdapter.dart';
import 'package:flutter/material.dart';

import '../../YColors.dart';

/**
 * 可以换行的Text并且最多两行
 * 可选默认参数
 */
Widget ExpandedText(str,{var color=YColors.a}){
  return Expanded(child: Text(
      str,
    style: TextStyle(
      fontSize: ScreenAdapter.size(28),
      color: color,
    ),
    overflow: TextOverflow.ellipsis,
    maxLines: 2,
  ));
}

Widget ExpandedTextColor(str){
  return Expanded(
    flex: 1,
      child:
  Text(
    str,
    style: TextStyle(
      fontSize: ScreenAdapter.size(28),
      color: YColors.a,
    ),
    overflow: TextOverflow.ellipsis,
    maxLines: 2,
  ));
}